// Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.

// 弹性伸缩策略api定义
package router

import (
	"fleetmanager/api/controller/policy"
	"github.com/beego/beego/v2/server/web"
)

func initPolicyRouters() {
	web.Router("/v1/:project_id/fleets/scaling-policies",
		&policy.CreateController{}, "post:CreatePolicy")
	web.Router("/v1/:project_id/fleets/scaling-policies",
		&policy.QueryController{}, "get:ListPolicy")
	web.Router("/v1/:project_id/fleets/scaling-policies/:policy_id",
		&policy.QueryController{}, "get:GetOnePolicy")
	web.Router("/v1/:project_id/fleets/scaling-policies/:policy_id",
		&policy.DeleteController{}, "delete:DeletePolicy")
	web.Router("/v1/:project_id/fleets/scaling-policies/:policy_id",
		&policy.UpdateController{}, "put:UpdatePolicy")
	// bind policy
	web.Router("/v1/:project_id/fleets/:fleet_id/scaling-policies/:policy_id/bind",
		&policy.UpdateController{}, "put:BindFleet;delete:UnBindFleet")
	web.Router("/v1/:project_id/fleets/scaling-policies/:policy_id/bind",
		&policy.QueryController{}, "get:GetBindRelationByPolicyId")
	web.Router("/v1/:project_id/fleets/:fleet_id/bind",
		&policy.QueryController{}, "get:GetBindRelationByFleetId")
}
